﻿using System;
using System.Collections.Generic;
using System.Text;

namespace 酒店管理
{
    class Consume
    {
        public void GiveSelectOrder(string RoomNum, string CustomerName)
            //刷新某个房间某个客人的已消费单
        {
            string sql = "select * from 房间消费 where 消费房间号='" + RoomNum + "' and 消费客户号=(select 客户号 from 客户 where 客户名='" + CustomerName + "')";
            ReturnsSql(sql);
        }

        public void ReduceVol(string GoodsCode, string Sum)
            //减少仓存
        {
            string sql = "update 仓存 set 当前仓存=当前仓存-" + Sum + ",where 消费类型='" + GoodsCode + "'";
            ReturnsSql(sql);
        }

        public void InBill(string In表单序号,string In账单号,string In消费客户号,string In消费房间号,string In消费项目号,string In名称,string In单价,string In单位,string In售出时间,string In数量)
            //添加消费
        {
            string sql = "insert into 房间消费 values(" + In表单序号 + ",'"+In账单号+"'," + In消费客户号 + ",'" + In消费房间号 + "','" + In消费项目号 + "','" + In名称 + "'," + In单价 + ",'" + In单位 + "','" + In售出时间 + "'," + In数量 + ")";
            ReturnsSql(sql);
        }

        public void Refunds(string In表单序号)
            //把商品退单,同时退单的商品当已使用处理不再放入仓存
        {
            string sql = "delete from 房间消费 where 表单序号=" + In表单序号;
            ReturnsSql(sql);
        }

        public void Change(string In表单序号, string TargetBillNum)
            //转单
        {
            string sql = "update 房间消费 set 账单号='" + TargetBillNum + "' where 表单序号=" + In表单序号;
            ReturnsSql(sql);
        }

        private string ReturnsSql(string sql)//放回SQL语句
        {
            return sql;
        }
    }
}
